The data for AirBnB contains detailed information on all of the approximately fifty thousand private apartment listings for rent through the site in New York City. The data is for a time before the COVID pandemic because I wanted to remove that additional complication for data analysis.
Selected Variables:
id: ID number of the listingtransit: description of the transit optionshost_id: a unique ID for the hosthost_listings_count: how many places does the host rent out?latitude/longitude: the Geo coordinatesroom_type / accommodates / bathrooms / bedrooms: some info about the place, like number of bed- and bathrooms, whether it is shared etc.price: nightly priceavailability_365: What part of the year is the property available to be rented?There are many other variables included, many of which are not needed and discarded.
There are three types of maps:
The file neighbourhoods.geojson is a GeoJSON file of NYC neighborhoods.
To start off, the neighborhood and borough geospatial objects, as well as the data frame that contains the airbnb listings, are imported. Required columns are selected and the price columns are cleaned, such that they are numeric. Monthly prices are imputed (using nightly price multiplied by 30) if they are not given.
## OGR data source with driver: ESRI Shapefile
## Source: "C:\Users\User\Desktop\work_samples\Data_Visualization\Airbnbs_in_NYC\data\nyc_boroughs_map\nybb.shp", layer: "nybb"
## with 5 features
## It has 4 fields
Answer: First the borough polygons and neighborhood outlines are overlapped with the NYC map tiles to give a base map for all of our visualizations. Each borough and neighborhood is labelled accordingly.
Then markers for each listing are added using the coordinates in the airbnb data frame. A few important pieces of information are provided as labels for each listing, including price, room type and their zipcode.
When zoomed into each of the five boroughs, it can be seen that listings are available across the entirety of Manhattan Island. In the other boroughs, they are more clustered at northwestern neighbourhoods of Queens (especially Astoria), as well as the northern neighbourhoods of Brooklyn (Greenpoint, Bushwick, Bedford-Stuyvesant, Williamsburg).